const {Schema, model} = require('mongoose')

const tokenSchema = new Schema(
  {
    id: {
      type: String,
      required: true,
      unique: true,
    },
    device: {
      type: String,
      required: true,
      unique: true,
    },
    token: {
      type: String,
      required: true,
      unique: true,
    },
    userId: {
      type: String,
      required: true,
    },
    date: {
      type: Date,
      required: true,
    },
  },
  {
    versionKey: false,
  },
)

module.exports = model('Token', tokenSchema)
